package com.zz.ecommerce.togatherDeclareMgr.custDeclarationUpload.dao;


import com.zz.ecommerce.togatherDeclareMgr.custDeclarationUpload.bean.MsgDecHistory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <一句话功能描述>
 * <功能详细描述>
 *
 * @author Administrator
 * @date 2015/8/15,16:34
 */
@Repository
public interface DecStatusDao {


    @Select("SELECT *\n" +
            " FROM (SELECT *\n" +
            "         FROM MSG_DEC_HISTORY T\n" +
            "        WHERE T.SEQ_NO = #{qryObj.seqNo}\n" +
            "          AND T.CLIENT_SEQ_NO IS NULL" +
            "          AND T.SEQ_NO IS NOT NULL\n" +
            "       UNION ALL\n" +
            "       SELECT *\n" +
            "         FROM MSG_DEC_HISTORY T\n" +
            "        WHERE T.CLIENT_SEQ_NO = #{qryObj.clientSeqNo} " +
            "          AND T.CLIENT_SEQ_NO IS NOT NULL)\n" +
            " ORDER BY ${sortOrder}")
    List<MsgDecHistory> queryCustDecStatusList(@Param("qryObj") MsgDecHistory status,
                                               @Param("sortOrder") String order);
}
